﻿<UserControl 
    x:Class="SilverDesigner.ToolbarMenu"         
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"    
    mc:Ignorable="d" d:DesignHeight="40" d:DesignWidth="400">
    <UserControl.Resources>
        <Style x:Name="menuButtonStyle" TargetType="Button">
            <Setter Property="Margin" Value="5" />
            <Setter Property="Padding" Value="15,0" />
            <Setter Property="HorizontalAlignment" Value="Left" />
            <Setter Property="Height" Value="30" />
            <Setter Property="Width" Value="Auto" />
        </Style>
        <Style x:Name="subMenuButtonStyle" TargetType="Button">
            <Setter Property="Margin" Value="2" />
            <Setter Property="Padding" Value="10,0" />
            <Setter Property="Height" Value="30" />
            <Setter Property="Width" Value="100" />
            <Setter Property="HorizontalContentAlignment" Value="Left" />
        </Style>
    </UserControl.Resources>
    <StackPanel x:Name="LayoutRoot" Orientation="Horizontal" Background="{StaticResource gradientBack3}">
        <StackPanel>
            <Button x:Name="btnFile" Content="File" Click="btnFile_Click" Style="{StaticResource menuButtonStyle}" />
            <Popup x:Name="fileMenu">
                <StackPanel Background="Silver">
                    <Button x:Name="btnNew" Content="New" Style="{StaticResource subMenuButtonStyle}" Click="btnNew_Click" />
                    <Button x:Name="btnOpen" Content="Open" Style="{StaticResource subMenuButtonStyle}" Click="btnOpen_Click" />
                    <Button x:Name="btnSave" Content="Save"  Style="{StaticResource subMenuButtonStyle}" Click="btnSave_Click" />
                </StackPanel>
            </Popup>
        </StackPanel>
        <StackPanel>
            <Button x:Name="btnEdit" Style="{StaticResource menuButtonStyle}" Content="Edit" Click="btnEdit_Click" />
            <Popup x:Name="editMenu">
                <StackPanel Background="Silver">
                    <Button x:Name="btnAddPage" Content="Add Page" Style="{StaticResource subMenuButtonStyle}" Click="btnAddPage_Click" />
                    <Button x:Name="btnHTMLEditor" Content="HTML Editor" Style="{StaticResource subMenuButtonStyle}" Click="btnHTMLEditor_Click" />
                </StackPanel>
            </Popup>
        </StackPanel>
        <StackPanel>
            <Button x:Name="btnView" Style="{StaticResource menuButtonStyle}" Content="View" Click="btnView_Click" />
            <Popup x:Name="viewMenu">
                <StackPanel Background="Silver">
                    <RadioButton x:Name="btnPageView" Content="Page View" IsChecked="True" Checked="btnPageView_Checked" GroupName="grpView" Margin="10" />
                    <RadioButton x:Name="btnDocumentView" Content="Document View" Checked="btnDocumentView_Checked" GroupName="grpView" Margin="10" />
                </StackPanel>
            </Popup>
        </StackPanel>
        <StackPanel>
            <Button x:Name="btnResources" Style="{StaticResource menuButtonStyle}" Content="Resources" Click="btnResources_Click" />
        </StackPanel>
    </StackPanel>
</UserControl>
    
    